Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 713 posts 954 karma points
    Apr 13, 2010 @ 04:45
    Tom
    1

    Get a Property Name from data[@alias='']

    Hi All,

    I'm constructing a table in an xslt file and would love to use a property's stored name as a label in a the table.. is there a way to do something like this

    <td><xsl:value-of select="data[@alias='cancelCompleteLong']/NAME OF PROPERTY THE ALIAS REFERS TO"/></td>
     <td><xsl:value-of select="data[@alias='cancelCompleteLong']"/></td>

     

    so the final output would be

    <td>Cancel Complete Sale (ie property name that the user reads in the backend when filling in the cms)</td>
     <td>no fee for sale cancellation (ie value of data referred to by alias)</td>

  • Tommy Poulsen 514 posts 708 karma points
    Apr 13, 2010 @ 07:58
    Tommy Poulsen
    3

    You may be able to use the library function GetPropertyTypeName

    umbraco.library:GetPropertyTypeName
  • Tom 713 posts 954 karma points
    Apr 13, 2010 @ 16:20
    Tom
    0

    Brilliant!

    thank you so much Tommy!

  • Tommy Poulsen 514 posts 708 karma points
    Apr 13, 2010 @ 17:45
    Tommy Poulsen
    0

    You are welcome ;-)

  • Giorgos Grispos 145 posts 179 karma points
    Sep 03, 2010 @ 14:13
    Giorgos Grispos
    0

    Hi all,

    I am quite new to umbraco and I need to use the umbraco.library:GetPropertyTypeName to get a value

    Could you give an idea on how to do that? The alias of my value is menuPageTitleENG

    <xsl:value-of select="umbraco.library:GetPropertyTypeName('String ContentTypeAlias', 'String PropertyTypeAlias')" disable-output-escaping="yes"/>

    which one is the String ContentTypeAlias and which one is the String PropertyTypeAlias


    I am blind, please help :-)

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Sep 03, 2010 @ 14:21
    Lee Kelleher
    0

    Hi Giorgos,

    The ContentTypeAlias is the document-type of your content page, and the PropertyTypeAlias is the property you want to use - in your case "menuPageTitleENG"

    Depending on which version of Umbraco you are using... for legacy XML schema (4.0.x):

    <xsl:value-of select="umbraco.library:GetPropertyTypeName(@nodeTypeAlias, 'menuPageTitleENG')" />

    For the new XML schema (4.5.x):

    <xsl:value-of select="umbraco.library:GetPropertyTypeName(name(.), 'menuPageTitleENG')" />

    Cheers, Lee.

  • Giorgos Grispos 145 posts 179 karma points
    Sep 03, 2010 @ 14:27
    Giorgos Grispos
    0

    Wow Lee yes that works,

    I am using the new schema and now how can I get tha value of the alias please...

    Cheers,

    Giorgos

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Sep 03, 2010 @ 14:35
    Lee Kelleher
    0

    Hi Giorgos,

    Depending on where you use this, guessing that its in a for-each loop? If so, try this:

    <xsl:value-of select="menuPageTitleENG" />

    If its outside a for-each, then add "$currentPage" to it.

    <xsl:value-of select="$currentPage/menuPageTitleENG" />

    Cheers, Lee.

  • Giorgos Grispos 145 posts 179 karma points
    Sep 03, 2010 @ 14:42
    Giorgos Grispos
    0

    Hi Lee

    Yes is inside a for-each loop and is working fine,

    Cheers,

    Giorgos

Please Sign in or register to post replies

Write your reply to:

Draft